package com.itcanteen.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itcanteen.reggie.entity.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author baimugudu
 * @email 2415621370@qq.com
 * @date 2022/10/22 10:10
 */

@Mapper
public interface EmployeeDao extends BaseMapper<Employee> {



    /**
     * 根据用户名查找用户
     * @param employee
     * @return
     */
    @Select("SELECT * FROM employee WHERE username=#{username}")
    Employee findByName(Employee employee);

    @Insert("INSERT INTO employee (name,username,password,phone,sex,id_number,status,create_time,update_time,create_user,update_user) " +
            "VALUES (#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
     void save(Employee employee);


}
